package bcared;
import java.sql.*;

public class Today {

	private ResultSet rs = null;
	private PreparedStatement ps = null;
	private OraDB myDB = new OraDB();
	private String today = null;

	public String getToday()
	throws ClassNotFoundException, SQLException, InstantiationException, IllegalAccessException {

		myDB.createConnection();
		String myQuery = "Select to_char(to_date('2/1/2009','MM/DD/YYYY'), 'MM/DD/YYYY') as today from dual";
		ps = myDB.conn.prepareStatement(myQuery);
		rs = ps.executeQuery();
		while (rs.next()) {
			today = rs.getString("today");
		}
		closeConnection();
		return today;
	}

	public void closeConnection()
	throws ClassNotFoundException, SQLException, InstantiationException, IllegalAccessException {
         if (myDB != null)
		   { myDB.closeConnection() ; }
	}

}
